import { Routes, Route, Navigate, useRoutes } from 'react-router-dom'
import Login from './views/Login';
import HomeViews from './views/HomeViews';
import JsglViews from './views/JsglViews';
import QxglViews from './views/QxglViews';
import YhglViews from './views/YhglViews';
import Page404 from './views/Page404';
const routes = [
  { path: "/", element: <Login /> },
  { path: "/login", element: <Login /> },
  {
    path: "/home",
    element: <HomeViews />,
    children: [
      // { path: ":id", element: <DoctorView /> },
      { path: "qxgl", element: <QxglViews /> },
      { path: "jsgl", element: <JsglViews /> },
      { path: "yhgl", element: <YhglViews /> },
      { path: "yhgl/:id", element: <YhglViews /> },

      { index: true, element: <YhglViews /> },
    ]
  },
  {
    path: "*", element: <Page404 />
  }
]
function App() {
  let element = useRoutes(routes)
  return (
    <div className="App">
      {element}
    </div>
  );
}

export default App;
